<include file="../Public/_header.html" />
<div class="so_main">
	<!-------- 搜索开始 -------->
	<div id="search_div">
		<div class="page_tit">
			搜索地点 [ <a href="javascript:void(0);" onclick="_show_searcharea();">隐藏</a> ]
		</div>
		<div class="sform">
			<form method="post" action="{:U('/AreaPopular/index')}" id="searchForm">
				<input id="pno" name="pno" type="hidden" value="1">
				<dl>
					<span>地区：</span>
	        			<input type="hidden" id="current" name='gparea' 
							value="{:assembleAreaIds($partner['province_id'],$partner['city_id'],$partner['area_id'])}"/>
						<!--province city area-->
						<input type="text" name="city"  id="selectarea"
							value="{:getAreaDesc($partner['province_id'],$partner['city_id'],$partner['area_id'])}"
							class="text" onfocus="this.className='text2'" onblur="this.className='text'" readonly 
							onclick="ui.box.load('{:U('Index://Public/area',array('selected'=>''))}'+$('#current').val(),{title:'选择城市'});" />
	      			<span>&nbsp;&nbsp;&nbsp;</span>
					<input type="submit" class="btn_b" value="提交" />
				</dl>
			</form>
		</div>
	</div>
	<!-------- 搜索结束 -------->
	
  	<div class="page_tit">地点管理</div>
  	<div class="Toolbar_inbox">
  		<a href="javascript:void(0);" class="btn_a" onclick="_show_searcharea();">
			<span>条件搜索</span>
		</a>
		<a href="{:U('/AreaPopular/add')}" class="btn_a" ><span>添加地点</span></a>
    	<a href="javascript:void(0);" class="btn_a" onclick="del();"><span>删除地点</span></a>
  	</div>
  
  	<div class="list">
	  	<table id="popular_list" width="100%" border="0" cellspacing="0" cellpadding="0">
		  	<tr>
		    	<th style="width:30px;">
			        <input type="checkbox" id="checkbox_handle" onclick="table_checkAll(this)" value="0">
			        <label for="checkbox"></label>
		    	</th>
		    	<th class="line_l">ID</th>
		    	<th class="line_l">地名</th>
		    	<th class="line_l">地区</th>
		    	<th class="line_l" style="text-align:right">总数</th>
		    	<th class="line_l" style="text-align:center">录入时间</th>
		    	<th class="line_l" style="text-align:center">操作</th>
		  	</tr>
		  	<volist id="vo" name="pagedata['data']">
		    <tr overstyle='on' id="popular_{$vo.popu_id}">
		        <td><input type="checkbox" name="checkbox" id="checkbox2" onclick="table_checkon(this)" value="{$vo.popu_id}"></td>
		        <td>{$vo.popu_id}</td>
		        <td>{$vo['title']}</td>
		        <td>{:getAreaDesc($vo['province_id'],$vo['city_id'],$vo['area_id'])}</td>
		        <td style="float:right">{$vo['item_sum']}</td>
		        <td style="text-align:center">{:paramMillisecond2Date($vo['ctime'],'Y-m-d')}</td>
		   
		        <td style="text-align:center">
		            <a href="{:U('/AreaPopular/edit',array('id'=>$vo['popu_id']))}" title="编辑地点" >编辑</a>&nbsp;&nbsp;
		            <a href="javascript:void(0);" onclick="del({$vo['popu_id']});" title="删除地点" >删除</a>&nbsp;&nbsp;
		        	<a href="{:U('Admin://AreaPopular/addStore',array('popu_id'=>$vo['popu_id']))}" title="添加地点下的店铺" >添加</a>&nbsp;&nbsp;
		        	<a href="{:U('Admin://AreaPopular/showStore',array('popu_id'=>$vo['popu_id']))}" title="查看地点下的店铺，并可进行删除！" >店铺</a>
		        </td>
			</tr>
		  	</volist>
	  	</table>
  	</div>
  	<div class="Toolbar_inbox">
    	<div class="page_box">{$pagedata['html']}</div>
  	</div>
</div>
<div class="clear"></div>
<script>
    //鼠标移动表格效果
    $(document).ready(function(){
    	table_init();
    });
    
    //删除分类
    function del(aid) {
        aid = aid ? aid : table_getChecked();
        aid = aid.toString();
        if(aid == '') return false;
		if(!confirm('确定删除么？')){
				return;
		}
        //提交删除
        $.post("{:U('/AreaPopular/del')}", {ids:aid}, function(res){
	        if(res == '1') {
		        aid = aid.split(',');
		        $.each(aid, function(i,n){
		            $('#popular_'+n).remove();
		        });
	            ui.success('删除成功');
	        }else {
	        	ui.success('删除失败');
	        }
        });
    }
    
    //添加热门地点下的店铺
    function addStore(){
    	
    }
</script>

<include file="../Public/_footer.html" />